package mylab.utils.common;

import lombok.experimental.UtilityClass;

@UtilityClass
public class ExceptionUtil extends cn.hutool.core.exceptions.ExceptionUtil {

    public <T> T notSupportMethod() {
        return throwException("not supported method");
    }

    public <T> T throwException(String message) {
        wrapRuntimeAndThrow(message);
        return CastUtil.cast(null);
    }

    public <T> T throwException(Throwable throwable) {
        return throwException(throwable.getMessage());
    }

    public <T> T throwException(String message, Throwable throwable) {
        return throwException(message);
    }
}
